package SqlConnect;

import java.sql.*;

public class SqlConnection {
    public SqlPassword password;
    public SqlInvestment inv;
    Connection connection;
    Statement st;

    public SqlConnection(String user, String password) throws SQLException {
        connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/Investment?useSSL=false", user, password);
        if (connection != null) {
            System.out.print("We have connected to our database!\r");
            st = connection.createStatement();
            this.password = new SqlPassword(st);
            this.inv = new SqlInvestment(st);
        }
    }
}
